<?php

include "../controller/ConectBanco.php";

class Tabela{
	
	public static function showTabela(){

		$result = mysql_query("SELECT distinct idPonto,max(realDateTime) realDateTime,pt.*,dv.*,pk.* 
				                 FROM ponto pt
					NATURAL LEFT JOIN device dv 
					NATURAL LEFT JOIN package  pk
								WHERE idUsuario=".$_SESSION["idUsuario"]."
							 GROUP BY idPonto" ) or die (mysql_error());
		
		while($array_lista = mysql_fetch_array($result)){
			echo '
					<tr>
					  <td >'.$array_lista['nomePonto'].'</td>
					  <td >'.$array_lista['typeData'].'</td>
					  <td >'.$array_lista['tipo'].'</td>
					  <td >'.$array_lista['info'].'</td>
					  		
					  <td >'.$array_lista['realDateTime'].'</td>
					
					  <td >'.$array_lista['velocidade'].'</td>
					   		
					  <td >'.$array_lista['tracking'].'</td>
					  <td >'.$array_lista['voltage'].'</td>
					  <td >'.$array_lista['acc'].'</td>
					  <td >'.$array_lista['charge'].'</td>
					  		
					  <td align="center">'.$array_lista['signal'].'</td> 
					
				</tr>			  		
				';
		}	
	}
}

?>
